<?php require "inc/pageTop.php"; ?>

<style>
#noscript {
	display: none;
}

#purchaseFormError {
	background: #ffcc00;
	background-repeat: repeat-x;
	background-image: -moz-linear-gradient(top, #ffcc00, #E6B800);
	background-image: -ms-linear-gradient(top, #ffcc00, #E6B800);
	background-image: -webkit-gradient(linear, left top, left bottom, from(#ffcc00), to(#E6B800));
	background-image: -webkit-linear-gradient(top, #ffcc00, #E6B800);
	background-image: -o-linear-gradient(top, #ffcc00, #E6B800);
	background-image: linear-gradient(top, #ffcc00, #E6B800);
	text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
	border: 1px solid rgba(0, 0, 0, 0.2);
	margin-bottom: 18px;
	margin-top: 15px;
	padding: 7px 14px;
	color: #404040;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
	-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
	list-style: none;
	display: none;
	font-size: 12px;
}

#purchaseCurrency {
	font-size: 16px;
	margin-left: 15px;
	color: #19446a;
}

#confirmDetails {
	display: none;
}

.confirmTitle {
	color: #333333;
}


#loadingPaypal {
	display: none;
	text-align: center;
	width: 200px;
	margin: 0 auto;
	font-size: 14px;
}
</style>

<noscript>
	<style>
		#toPurchase {
			display: none;
		}
		
		#confirmDetails {
			display: none;
		}
		
		#loadingPaypal {
			display: none;
		}
		
		#noscript {
			display: block;
		}
	</style>
</noscript>

<?php
	$errorMessage = "";
	
	$posted_formatType = "";
	$posted_email = "";
	$posted_firstName = "";
	$posted_lastName = "";
	$posted_houseNameNumber = "";
	$posted_street = "";
	$posted_town = "";
	$posted_city = "";
	$posted_zipPostCode = "";

	if(isset($_POST["txtEmail"])){
	
		$posted_formatType = $_POST["guideFormat"];
		$posted_email = htmlentities($_POST["txtEmail"]);
		$posted_firstName = htmlentities($_POST["txtFirstName"]);
		$posted_lastName = htmlentities($_POST["txtLastName"]);
		$posted_houseNameNumber = htmlentities($_POST["txtHouseNameNumber"]);
		$posted_street = htmlentities($_POST["txtStreet"]);
		$posted_town = htmlentities($_POST["txtTown"]);
		$posted_city = htmlentities($_POST["txtCity"]);
		$posted_zipPostCode = htmlentities($_POST["txtZipPostCode"]);
	
		if($posted_formatType == "cd"){
			$requiredArray = array(
				"currency",
				"txtEmail",
				"txtFirstName",
				"txtLastName",
				"txtHouseNameNumber",
				"txtStreet",
				"txtTown",
				"txtCity",
				"country",
				"txtZipPostCode"
			);
		} else {
			$requiredArray = array(
				"currency",
				"txtEmail",
				"txtFirstName",
				"txtLastName",
			);
		}
		
		$oneEmpty = false;
		
		for($i = 0; $i < count($requiredArray); $i++){
			if(trim($_POST[$requiredArray[$i]]) == ""){
				$oneEmpty = true;
			}
		}
		
		if($oneEmpty == true){
			$errorMessage = "Please fill in all fields";
			?>
			<style>
			#purchaseFormError {
				display: block;
			}
			</style>
			<?php
		} else {
			//CHECK EMAIL
			if(preg_match("/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/", $_POST["txtEmail"])){
			
				//CHECK FOR INVALID CHARACTERS
				if($posted_formatType == "cd"){
					$characterCheckList = array(
						"txtFirstName",
						"txtLastName",
						"txtHouseNameNumber",
						"txtStreet",
						"txtTown",
						"txtCity",
						"txtZipPostCode"
					);
				} else {
					$characterCheckList = array(
						"txtFirstName",
						"txtLastName"
					);
				}
				
				$isInvalid = "";
				
				for($i = 0; $i < count($characterCheckList); $i++){
					if(!preg_match("/^[a-zA-Z0-9' ]+$/", $_POST[$characterCheckList[$i]])){
						switch($characterCheckList[$i]){
							case "txtFirstName":
								$fieldName = "First name";
							break;
							case "txtLastName":
								$fieldName = "Last name";
							break;
							case "txtHouseNameNumber":
								$fieldName = "House name/number";
							break;
							case "txtStreet":
								$fieldName = "Street";
							break;
							case "txtTown":
								$fieldName = "Town";
							break;
							case "txtCity":
								$fieldName = "City";
							break;
							case "txtZipPostCode":
								$fieldName = "Zip/Post code";
							break;
						}
						
						$isInvalid = $fieldName." contains invalid characters(s)";
					}
				}
					if($isInvalid == ""){
				?>
				<style>
					#toPurchase {
						display: none;
					}
					
					#confirmDetails {
						display: block;
					}
				</style>
				<script>
					//CONFIRM DETIALS
					var _0xab07=["\x68\x69\x64\x65","\x23\x63\x6F\x6E\x66\x69\x72\x6D\x44\x65\x74\x61\x69\x6C\x73","\x73\x68\x6F\x77","\x23\x6C\x6F\x61\x64\x69\x6E\x67\x50\x61\x79\x70\x61\x6C","\x73\x75\x62\x6D\x69\x74","\x23\x69\x70\x6E\x50\x6F\x73\x74","\x63\x6C\x69\x63\x6B","\x2E\x62\x74\x6E\x43\x6F\x6E\x66\x69\x72\x6D\x44\x65\x74\x61\x69\x6C\x73","\x72\x65\x61\x64\x79"]
					$(document)[_0xab07[8]](function ()
					{
					$(_0xab07[7])[_0xab07[6]](function ()
					{
					$(_0xab07[1])[_0xab07[0]]();
					$(_0xab07[3])[_0xab07[2]]();
					$(_0xab07[5])[_0xab07[4]]();
					}
					);
					}
					);

				</script>
				
				<form action="https://www.paypal.com/cgi-bin/webscr" method="POST" id="ipnPost">
					<input type="hidden" name="cmd" value="_xclick" />
					<input type="hidden" name="business" value="paypal@moneybug.net" />
					<input type="hidden" name="item_name" value="MoneyBug Guide" />
					<input type="hidden" name="item_number" value="1" />
					<!--<input type="hidden" name="amount" value="<?php echo htmlentities($_POST["price"]); ?>" />-->
					<input type="hidden" name="amount" value="0.01" />
					<input type="hidden" name="no_shipping" value="1" />
					<input type="hidden" name="no_note" value="1" />
					<input type="hidden" name="currency_code" value="<?php echo htmlentities($_POST["currency"]); ?>" />
					<!--<input type="hidden" name="lc" value="GB" />-->
					<input type="hidden" name="return" value="http://www.moneybug.net/payment/thankyou.php" />
					<input type="hidden" name="cancel_return" value="http://www.moneybug.net/payment/cancel.php" />
					<input type="hidden" name="rm" value="2" />
					<input type="hidden" name="notify_url" value="http://www.moneybug.net/payment/ipn.php" />
					
					<?php
					if($posted_formatType == "cd"){
						$userDetaisArray = array(
							$posted_formatType,
							$posted_email,
							$posted_firstName,
							$posted_lastName,
							$posted_houseNameNumber,
							$posted_street,
							$posted_town,
							$posted_city,
							$_POST["country"],
							$posted_zipPostCode
						);
					} else {
						$userDetaisArray = array(
							$posted_formatType,
							$posted_email,
							$posted_firstName,
							$posted_lastName
						);
					}
						
						$customString = "";
						
						foreach($userDetaisArray as $detail){
							$customString .= $detail."|";
						}
					?>
					
					<input type="hidden" name="custom" value="<?php echo $customString; ?>" />
					
				</form>
				<?php
				} else {
					$errorMessage = $isInvalid;
					?>
					<style>
					#purchaseFormError {
						display: block;
					}
					</style>
					<?php
				}
				
			} else {
				$errorMessage = "Invalid email address";
				?>
				<style>
				#purchaseFormError {
					display: block;
				}
				</style>
				<?php
				}
				
			}
		}
	
?>

<script>
	$(document).ready(function(){
	
		//HIDE DELIVERY FORM
		$(".deliveryDetail").hide();
		
		//DOWNLOAD OR CD CLICK
		var formatType = "download";
		$("[name=guideFormat]").click(function(){
			if($(this).val() == "cd"){
				$(".deliveryDetail").show();
				$(".downloadDetail").hide();
				formatType = "cd";
			} else {
				$(".deliveryDetail").hide();
				$(".downloadDetail").show();
				formatType = "download";
			}
		});
	
		//PURCHASE NOW
		$("#purchaseNow").click(function(){
			
			var _0x7fb8=["","\x74\x65\x78\x74","\x23\x70\x75\x72\x63\x68\x61\x73\x65\x46\x6F\x72\x6D\x45\x72\x72\x6F\x72","\x68\x69\x64\x65"]
			$(_0x7fb8[2])[_0x7fb8[1]](_0x7fb8[0]);
			$(_0x7fb8[2])[_0x7fb8[3]]();

			if(formatType == "cd"){
				var _0xa8e4=["\x63\x75\x72\x72\x65\x6E\x63\x79","\x74\x78\x74\x45\x6D\x61\x69\x6C","\x74\x78\x74\x46\x69\x72\x73\x74\x4E\x61\x6D\x65","\x74\x78\x74\x4C\x61\x73\x74\x4E\x61\x6D\x65","\x74\x78\x74\x48\x6F\x75\x73\x65\x4E\x61\x6D\x65\x4E\x75\x6D\x62\x65\x72","\x74\x78\x74\x53\x74\x72\x65\x65\x74","\x74\x78\x74\x54\x6F\x77\x6E","\x74\x78\x74\x43\x69\x74\x79","\x63\x6F\x75\x6E\x74\x72\x79","\x74\x78\x74\x5A\x69\x70\x50\x6F\x73\x74\x43\x6F\x64\x65"]
				var requiredList= new Array(_0xa8e4[0],_0xa8e4[1],_0xa8e4[2],_0xa8e4[3],_0xa8e4[4],_0xa8e4[5],_0xa8e4[6],_0xa8e4[7],_0xa8e4[8],_0xa8e4[9]);
			} else {
				var requiredList = new Array(
					"txtEmail",
					"txtFirstName",
					"txtLastName"
				);
			}

			
			var oneEmpty = false;
			
			//CHECK IF A FIELD IS EMPTY
			var _0x62f5=["\x6C\x65\x6E\x67\x74\x68","\x74\x72\x69\x6D","\x76\x61\x6C","\x5B\x6E\x61\x6D\x65\x3D","\x5D",""]
			for(var i=0;i<requiredList[_0x62f5[0]];i++)
			{
			if($(_0x62f5[3]+requiredList[i]+_0x62f5[4])[_0x62f5[2]]()[_0x62f5[1]]()==_0x62f5[5])
			{
			oneEmpty=true;
			}
			}
			
			if(oneEmpty == true){
				//All FIELDS MUST BE FILLED IN
				var _0x7bb9=["\x50\x6C\x65\x61\x73\x65\x20\x66\x69\x6C\x6C\x20\x69\x6E\x20\x61\x6C\x6C\x20\x66\x69\x65\x6C\x64\x73","\x74\x65\x78\x74","\x23\x70\x75\x72\x63\x68\x61\x73\x65\x46\x6F\x72\x6D\x45\x72\x72\x6F\x72","\x73\x68\x6F\x77"]
				$(_0x7bb9[2])[_0x7bb9[1]](_0x7bb9[0]);
				$(_0x7bb9[2])[_0x7bb9[3]]();
				
				//cnobf
				$("#purchaseFormError").css({
					"display" : "block"
				});
				
			} else {
				//CHECK EMAIL
				
				var _0xe9df=["\x74\x72\x69\x6D","\x76\x61\x6C","\x5B\x6E\x61\x6D\x65\x3D\x74\x78\x74\x45\x6D\x61\x69\x6C\x5D","\x74\x65\x73\x74"]
				var email=$(_0xe9df[2])[_0xe9df[1]]()[_0xe9df[0]]();
				var emailRegex=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
				var validEmail=emailRegex[_0xe9df[3]](email);
				
				if(formatType == "cd"){
					//CHECK IF FIELD CONTAINS INVALID CHARACTERS
					var _0xd225=["\x74\x78\x74\x46\x69\x72\x73\x74\x4E\x61\x6D\x65","\x74\x78\x74\x4C\x61\x73\x74\x4E\x61\x6D\x65","\x74\x78\x74\x48\x6F\x75\x73\x65\x4E\x61\x6D\x65\x4E\x75\x6D\x62\x65\x72","\x74\x78\x74\x53\x74\x72\x65\x65\x74","\x74\x78\x74\x54\x6F\x77\x6E","\x74\x78\x74\x43\x69\x74\x79","\x74\x78\x74\x5A\x69\x70\x50\x6F\x73\x74\x43\x6F\x64\x65"]
					var characterCheckList= new Array(_0xd225[0],_0xd225[1],_0xd225[2],_0xd225[3],_0xd225[4],_0xd225[5],_0xd225[6]);
				} else {
					var characterCheckList = new Array(
						"txtFirstName",
						"txtLastName"
					);
				}	
					
					var invalidField = false;
					
					for(var i = 0; i < characterCheckList.length; i++){
						
						if(!($("[name=" + characterCheckList[i] + "]").val()).match(/^[a-zA-Z0-9' ]+$/)) {
							invalidField = true;
							
							var _0x354a=["\x46\x69\x72\x73\x74\x20\x6E\x61\x6D\x65","\x74\x78\x74\x46\x69\x72\x73\x74\x4E\x61\x6D\x65","\x4C\x61\x73\x74\x20\x6E\x61\x6D\x65","\x74\x78\x74\x4C\x61\x73\x74\x4E\x61\x6D\x65","\x48\x6F\x75\x73\x65\x20\x6E\x61\x6D\x65\x2F\x6E\x75\x6D\x62\x65\x72","\x74\x78\x74\x48\x6F\x75\x73\x65\x4E\x61\x6D\x65\x4E\x75\x6D\x62\x65\x72","\x53\x74\x72\x65\x65\x74","\x74\x78\x74\x53\x74\x72\x65\x65\x74","\x54\x6F\x77\x6E","\x74\x78\x74\x54\x6F\x77\x6E","\x43\x69\x74\x79","\x74\x78\x74\x43\x69\x74\x79","\x5A\x69\x70\x2F\x50\x6F\x73\x74\x20\x63\x6F\x64\x65","\x74\x78\x74\x5A\x69\x70\x50\x6F\x73\x74\x43\x6F\x64\x65"]
							switch(characterCheckList[i])
							{
							case _0x354a[1]:var fieldName=_0x354a[0];
							break ;
							case _0x354a[3]:var fieldName=_0x354a[2];
							break ;
							case _0x354a[5]:var fieldName=_0x354a[4];
							break ;
							case _0x354a[7]:var fieldName=_0x354a[6];
							break ;
							case _0x354a[9]:var fieldName=_0x354a[8];
							break ;
							case _0x354a[11]:var fieldName=_0x354a[10];
							break ;
							case _0x354a[13]:var fieldName=_0x354a[12];
							break ;
							}

							
							var _0xfc1c=["\x20\x63\x6F\x6E\x74\x61\x69\x6E\x73\x20\x69\x6E\x76\x61\x6C\x69\x64\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x28\x73\x29","\x74\x65\x78\x74","\x23\x70\x75\x72\x63\x68\x61\x73\x65\x46\x6F\x72\x6D\x45\x72\x72\x6F\x72","\x73\x68\x6F\x77"]
							$(_0xfc1c[2])[_0xfc1c[1]](fieldName+_0xfc1c[0]);
							$(_0xfc1c[2])[_0xfc1c[3]]();

							
							$("#purchaseFormError").css({
								"display" : "block"
							});
						}
					}
					
					if(invalidField == false){
						if(validEmail == true){
							$("#FormDetails").submit();
						} else {
							$("#purchaseFormError").text("Invalid email address");
							$("#purchaseFormError").show();
							
							$("#purchaseFormError").css({
								"display" : "block"
							});
						}
					}
			}	
	
		});
		
		var _0x79b6=["\x76\x61\x6C","\x5B\x6E\x61\x6D\x65\x3D\x63\x75\x72\x72\x65\x6E\x63\x79\x5D","\x47\x42\x50","\x26\x70\x6F\x75\x6E\x64\x3B\x39\x2E\x39\x39","\x45\x55\x52","\x26\x65\x75\x72\x6F\x3B\x31\x31\x2E\x39\x39","\x55\x53\x44","\x26\x23\x33\x36\x3B\x31\x34\x2E\x39\x39","\x68\x74\x6D\x6C","\x23\x70\x75\x72\x63\x68\x61\x73\x65\x43\x75\x72\x72\x65\x6E\x63\x79","\x5B\x6E\x61\x6D\x65\x3D\x70\x72\x69\x63\x65\x5D","\x63\x68\x61\x6E\x67\x65"]
		$(_0x79b6[1])[_0x79b6[11]](function ()
		{
		if($(_0x79b6[1])[_0x79b6[0]]()==_0x79b6[2])
		{
		var _0x62edx1=9.99;
		var _0x62edx2=_0x79b6[3];
		}
		else 
		{
		if($(_0x79b6[1])[_0x79b6[0]]()==_0x79b6[4])
		{
		var _0x62edx1=11.99;
		var _0x62edx2=_0x79b6[5];
		}
		else 
		{
		if($(_0x79b6[1])[_0x79b6[0]]()==_0x79b6[6])
		{
		var _0x62edx1=14.99;
		var _0x62edx2=_0x79b6[7];
		}
		}
		}
		$(_0x79b6[9])[_0x79b6[8]](_0x62edx2);
		$(_0x79b6[10])[_0x79b6[0]](_0x62edx1);
		}
		);

		
	});
</script>
<div id="toPurchase">
   	<div class="header_01">Purchase</div>
        <img src="/images/purchaseCD.png" align="left" style="margin-right:30px;" />
		<p>
		Fill in the form below to purchase your guide. The guide is not electronic and will be delivered to the destination you provide (allow up to 3-10 working days for delivery, depending on your location).
		</p>	

	<form action="" method="POST" id="FormDetails">
		<table style="margin:80px 0 0 0">
			<tr>
				<td colspan="2"><span id="purchaseFormError"><?php echo $errorMessage; ?></span></td>
			</tr>
			<tr>
				<td>Currency: </td><td>
										<select name="currency">
											<option value="USD" selected="selected">USD</option>
											<option value="GBP">GBP</option>
											<option value="EUR">EUR</option>
										</select>
										<span id="purchaseCurrency">$14.99</span>
										<input type="hidden" name="price" value="14.99" />
								   </td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td>Guide Format: </td><td><input type="radio" name="guideFormat" value="download" id="formatDownload" checked="checked" /> <label for="formatDownload">Download</label> <input type="radio" name="guideFormat" id="formatCD" value="cd" /> <label for="formatCD">CD</label></td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td>Email: </td><td><input type="text" name="txtEmail" value="<?php echo $posted_email; ?>" maxlength="50" /></td>
			</tr>
			<tr>
				<td>First name: </td><td><input type="text" name="txtFirstName" value="<?php echo $posted_firstName; ?>" maxlength="20" /></td>
			</tr>
			<tr>
				<td>Last name: </td><td><input type="text" name="txtLastName" value="<?php echo $posted_lastName; ?>" maxlength="20" /></td>
			</tr>
			<tr>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr class="downloadDetail">
				<td colspan="2">A download link will be sent to your email. You will have a maximum time of 1 hour to complete the download.</td>
			</tr>
			<tr class="downloadDetail">
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr class="deliveryDetail">
				<td align="center" colspan="2"><h3>Deliver to:</h3></td>
			</tr>
			<tr class="deliveryDetail">
				<td>House name/number: </td><td><input type="text" name="txtHouseNameNumber" value="<?php echo $posted_houseNameNumber; ?>" maxlength="20" /></td>
			</tr>
			<tr class="deliveryDetail">
				<td>Street: </td><td><input type="text" name="txtStreet" value="<?php echo $posted_street; ?>" maxlength="30" /></td>
			</tr>
			<tr class="deliveryDetail">
				<td>Town: </td><td><input type="text" name="txtTown" value="<?php echo $posted_town; ?>" maxlength="30" /></td>
			</tr>
			<tr class="deliveryDetail">
				<td>City: </td><td><input type="text" name="txtCity" value="<?php echo $posted_city; ?>" maxlength="30" /></td>
			</tr>
			<tr class="deliveryDetail">
				<td>Zip/Post code: </td><td><input type="text" name="txtZipPostCode" value="<?php echo $posted_zipPostCode; ?>" maxlength="20" /></td>
			</tr>
			<tr class="deliveryDetail">
				<td>Country: </td><td><?php include "php/countryList.php"; ?></td>
			</tr>
			<tr class="deliveryDetail">
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr class="deliveryDetail">
				<td colspan="2">If this form does not take the address you want, please contact us.</td>
			</tr class="deliveryDetail">
			<tr class="deliveryDetail">
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="2">
					<a href="javascript:void(0);" id="purchaseNow">Proceed</a>
					<!--<input type="submit" value="submit" />-->
				</td>
			</tr>
		</table>
	</form>
</div>

<div id="noscript">
	To view this page you need to enable Javascript. Click <a href="http://support.google.com/bin/answer.py?hl=en&answer=23852" target="_blank">HERE</a> to find out how to enable Javascript.
</div>

<div id="confirmDetails">
	<div class="header_01">Confirm Details</div>
	<table style="margin: 0 auto;">
		<tr>
			<td class='confirmTitle'>Cost: </td><td><?php echo @htmlentities($_POST["price"]); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Currency: </td><td><?php echo @htmlentities($_POST["currency"]); ?></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td class='confirmTitle'>Guide format: </td><td><?php echo @strtoupper($posted_formatType); ?></td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td class='confirmTitle'>Email: </td><td><?php echo @$posted_email; ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>First name: </td><td><?php echo @ucfirst($posted_firstName); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Last name: </td><td><?php echo @ucfirst($posted_lastName); ?></td>
		</tr>
		<?php if($posted_formatType == "cd") { ?>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td class='confirmTitle'>House name/number: </td><td><?php echo @ucwords($posted_houseNameNumber); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Street: </td><td><?php echo @ucwords($posted_street); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Town: </td><td><?php echo @ucwords($posted_town); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>City: </td><td><?php echo @ucwords($posted_city); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Zip/Post code: </td><td><?php echo @strtoupper($posted_zipPostCode); ?></td>
		</tr>
		<tr>
			<td class='confirmTitle'>Country: </td><td><?php echo @htmlentities($_POST["country"]); ?></td>
		</tr>
		<?php } ?>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2" style="border-top:1px solid #E2E2E2;padding-top:15px;">By purchasing this guide you accept the <a href="/terms" target="_blank">terms & conditions</a>. You will now be redirected to Paypal to pay for this guide. Please note a paypal account is NOT required.</td>
		</tr>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		
		<tr>
			<td colspan="2">
				<a href="javascript:void(0);" id="purchaseNow" class="btnConfirmDetails">Confirm</a>
			</td>
		</tr>
	</table>
</div>

<div id="loadingPaypal">
	<p>Redirecting to Paypal...</p>
	<img src="/images/loading.gif" />
</div>
			
<?php require "inc/pageBottom.php"; ?>   